using System;
using System.Data.Linq.Mapping;
using System.Runtime.Serialization;
using CoreLibrary;
using CoreLibrary.Date;

namespace Entities.DataBase.Persistent {

    [DataContract]
    [Table(Name="D_SETTING")]
    public class Setting {

        public Setting() {
            Id = GuidUtil.GuidN();
            DateCreated = DateTime.UtcNow;
            DateUpdated = DateUtil.Epoch;
        }

        [DataMember]
        [Column(Name = "ID", IsPrimaryKey = true)]
        public string Id { get; set; }

        [DataMember]
        [Column(Name = "NAME")]
        public string Name { get; set; }

        [DataMember]
        [Column(Name = "CNAME")]
        public string CName { get; set; }

        [DataMember]
        [Column(Name = "VALUE")]
        public string Value { get; set; }

        [DataMember]
        [Column(Name = "DATE_CREATED")]
        public DateTime DateCreated { get; set; }

        [DataMember]
        [Column(Name = "DATE_UPDATED")]
        public DateTime DateUpdated { get; set; }
    }
}